/**
 * Copyright 2008 Mathias Doenitz, http://lis.to/
 *
 * This file is part of the lis.to java desktop client. The lis.to java desktop client is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free
 * Software Foundation, either version 3 of the License, or (at your option) any later version.
 *
 * The lis.to java desktop client is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with the lis.to java desktop client.
 * If not, see http://www.gnu.org/licenses/
 */

package listo.utils.reflection;

import com.google.inject.ImplementedBy;

import java.util.List;

/**
 * Provides general, not object specific reflection functionality.
 */
@ImplementedBy(ReflectorImpl.class)
public interface Reflector {

    /**
     * Creates a ReflectorWrapper for the given object.
     *
     * @param obj the object
     * @return the wrapper
     */
    public ReflectorWrapper f(Object obj);

    /**
     * Creates a ReflectorWrapper for the given class.
     *
     * @param clazz the class
     * @return the wrapper
     */
    public ReflectorWrapper f(Class clazz);

    /**
     * Gets the classes contained in the packages with the given names.
     *
     * @param packageNames the packages to search through
     * @return the list of classes found in the packages
     */
    public List<Class> getClassesOfPackages(String... packageNames);

    /**
     * Returns the most specialized common base type of the given objects or null,
     * if the given array is empty or contains at least one null entry.
     *
     * @param objects the objects
     * @return the common base type or null
     */
    public Class getCommonType(Object[] objects);

}
